// 工具函数
function getRandomId() {
    return Math.random().toString(36).substr(2, 9);
}

function formatDate(date) {
    return new Date(date).toLocaleString();
}

function saveNotesToLocalStorage(notes) {
    localStorage.setItem('notes', JSON.stringify(notes));
}

function getNotesFromLocalStorage() {
    const notes = localStorage.getItem('notes');
    return notes ? JSON.parse(notes) : [];
}